<?php $this->load->view('partials/breadcrumb.tpl', Array('_BTN_GROUP' => array('url' => site_url($thisModule . $thisController), 'class' => 'btn default', 'name' => '返回列表', 'i' => '<i class="m-icon-swapleft"></i>'))) ?>
<div class="row">
    <div class="col-md-12">
        <div class="portlet box yellow">
            <div class="portlet-title">
                <div class="caption">
                    <i class="fa fa-coffee"></i>物流信息
                </div>
            </div>
            <div class="portlet-body">
                <div class="table-scrollable">
                    <table class="table table-bordered table-hover">
                        <tbody>
                        <tr>
                            <th class="text-right">入库ID：</th>
                            <td class="text-left"><?= $obj->id ?></td>

                            <th class="text-right">所属账户：</th>
                            <td class="text-left"><?= $allShops[$obj->shop_id] ?></td>

                            <th class="text-right">采购人：</th>
                            <td class="text-left"><?= $obj->purchase_person ?></td>
                        </tr>
                        <tr>
                            <th class="text-right">商品名称：</th>
                            <td class="text-left"><?= $obj->product_name ?></td>

                            <th class="text-right">商品单价：</th>
                            <td class="text-left"><?= $obj->product_price ?></td>

                            <th class="text-right">商品数量/剩余数量：</th>
                            <td class="text-left"><?= $obj->product_quantity ?>/ <span style="color: red;"><?= $obj->left_quantity ?></span></td>
                        </tr>
                        <tr>
                            <th class="text-right">商品总价：</th>
                            <td class="text-left"><?= $obj->product_amount ?></td>

                            <th class="text-right">入库批次：</th>
                            <td class="text-left"><?= $obj->batch ?></td>

                            <th class="text-right">入库方式：</th>
                            <td class="text-left"><?= IOSS_StaticConfig::getShippingInType($obj->in_mark) ?></td>
                        </tr>
                        <tr>
                            <th class="text-right">存储仓库：</th>
                            <td class="text-left"><?= IOSS_StaticConfig::getShippingWarehouse($obj->warehouse) ?></td>

                            <th class="text-right">存储仓库区：</th>
                            <td class="text-left"><?= IOSS_StaticConfig::getShippingBlock($obj->warehouse_area) ?></td>

                            <th class="text-right">录入人：</th>
                            <td class="text-left"><?= $allPurchaser[$obj->operator_id] ?></td>
                        </tr>
                        <tr>
                            <th class="text-right">采购日期：</th>
                            <td class="text-left"><?= date('Y-m-d',$obj->purchase_time) ?></td>

                            <th class="text-right">创建时间：</th>
                            <td colspan="3" class="text-left"><?= date('Y-m-d',$obj->create_time) ?></td>

                        </tr>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="col-md-12">
        <!-- BEGIN BORDERED TABLE PORTLET-->
        <div class="portlet box purple">
            <div class="portlet-title">
                <div class="caption"
                     style="display: flex;justify-content: space-between;width: 100%;align-items: center;">
                    <div>
                        操作日志
                    </div>
                </div>
            </div>
            <div class="portlet-body">
                <?php foreach ($logs as $v): ?>
                    <div><b><?= $v->id ?>：</b><span><?= $allPurchaser[$v->user_id] ?></span>于 <span><?= date('Y-m-d H:i',$v->create_time) ?></span>操作<span style="color: #ff1f1c;"><?= $v->content ?></></div>
                <br>
                <?php endforeach; ?>
            </div>
        </div>
    </div>

</div>

<script>
    $(document).ready(function () {
        var list = $(".left-item");
        var total = 0;
        for (var i = 0; i < list.length; i++) {
            total += parseFloat(list.eq(i).text());
        }
        $("#total").html(total);
    })
</script>